/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.synnapps.example.carouselview;

import com.synnapps.carouselview.AttrValue;
import com.synnapps.carouselview.ResourceTable;

import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;

import ohos.app.Context;

import org.junit.Test;

/**
 * 单元测试类
 */
public class CarouselviewOhosTest {
    private Context context;

    /**
     * 获取上下文
     */
    public void initClass() {
        context = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility().getContext();
    }

    /**
     * 获取xml 25vp值
     */
    @Test
    public void testGetDimension25vp() {
        initClass();
        int dimension = AttrValue.getDimension(context, ResourceTable.Float_default_indicator_margin_vertical);
    }

    /**
     * 获取xml 10vp值
     */
    @Test
    public void testGetDimension10vp() {
        initClass();
        int dimension = AttrValue.getDimension(context, ResourceTable.Float_default_indicator_margin_horizontal);
    }

    /**
     * 获取xml 1vp值
     */
    @Test
    public void testGetDimension1vp() {
        initClass();
        int dimension = AttrValue.getDimension(context, ResourceTable.Float_default_circle_indicator_stroke_width);
    }

    /**
     * 获取xml 6vp值
     */
    @Test
    public void testGetDimension6vp() {
        initClass();
        int dimension = AttrValue.getDimension(context, ResourceTable.Float_default_circle_indicator_radius);
    }
}